using System;
using Android.App;
using Android.Preferences;

namespace jivemessenger
{
    public static class StaticSettings
    {
        public static Activity GlobalContext = null;

        public const string JiveTag = "JiveMessenger";
        public static bool IsTileNotificationEnabledSetting = false;
        //public static bool IsToastNotificationEnabledSetting = false;

        public static string Username
        {
            get
            {
#if DEBUG
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditUsernamePreference", "sskodje@gmail.com");
#else
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditUsernamePreference", ""); 
#endif

            }
        }
        public static string Password
        {
            get
            {
#if DEBUG
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditPasswordPreference", "sverrek1983");
#else
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditPasswordPreference", "");
#endif
            }
        }
        public static string Server
        {
            get
            {
#if DEBUG
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditServerPreference", "10.0.2.2");
#else
                return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("EditServerPreference", "");
#endif
            }

        }

        public static bool StoreMessagesWhileOffline
        {
            get { return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetBoolean("CheckboxStoreMessagesWhileOffline_preference", true); }
        }
        public static int OfflineMessagesCountLimit
        {
            get { return Int32.Parse(PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("OfflineMessagesCountLimitPreference", "150")); }
        }
        public static int OfflineMessagesAgeLimit
        {
            get { return Int32.Parse(PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("OfflineMessagesAgeLimitPreference", "6")); }
        }

        public static bool IsToastNotificationEnabledSetting
        {
            get { return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetBoolean("CheckboxEnableToast_preference", false); }
        }
        public static bool DisableLockscreen
        {
            get { return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetBoolean("CheckboxDisableLockscreen_preference", false); }
        }
        public static bool AutoReconnect
        {
            get { return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetBoolean("CheckboxAutoReconnect_preference", true); }

        }

        public static string SavedChatBubbles
        {
            get { return PreferenceManager.GetDefaultSharedPreferences(GlobalContext).GetString("SavedChatBubbles", ""); }
            set { PreferenceManager.GetDefaultSharedPreferences(GlobalContext).Edit().PutString("SavedChatBubbles", value); }
        }

        public static int ServerPort
        {
#if DEBUG
            get { return 36411; }
#else
                        get { return 36410; }
#endif
        }
    }

}